#include "edge.h"

HalfEdge::HalfEdge(unsigned int _id) : id (_id){
    edge = NULL;
    start = NULL;
    loop = NULL;
    next = NULL;
    prev = NULL;
}

HalfEdge::HalfEdge(unsigned int _id, Vertex *_s, Loop *_l) : id(_id), start(_s), loop(_l){
    edge = NULL;
    next = NULL;
    prev = NULL;
}

HalfEdge::HalfEdge(unsigned int _id, Edge *_e, Vertex *_s, Loop *_l) : id(_id), edge(_e), start(_s), loop(_l){
    next = NULL;
    prev = NULL;
}

HalfEdge::~HalfEdge(){
}

void HalfEdge::setEdge(Edge *_e){
    edge = _e;
}

void HalfEdge::setStart(Vertex *_s){
    start = _s;
}

void HalfEdge::setLoop(Loop *_l){
    loop = _l;
}

unsigned int HalfEdge::getID(){
    return id;
}

Edge *HalfEdge::getEdge(){
    return edge;
}

Vertex *HalfEdge::getStart(){
    return start;
}

Loop *HalfEdge::getLoop(){
    return loop;
}

HalfEdge *HalfEdge::getTwin(){
    HalfEdge *he = edge->getHE1();
    if (this == he)
        return edge->getHE2();
    return he;
}

void HalfEdge::setNext(HalfEdge *_n){
    next = _n;
}

void HalfEdge::setPrev(HalfEdge *_p){
    prev = _p;
}

HalfEdge *HalfEdge::getNext(){
    return next;
}

HalfEdge *HalfEdge::getPrev(){
    return prev;
}
